package DesignMode.template;

import java.util.Arrays;

/**
 * @auther zhouliangliang
 * @date 2022/11/15 9:22
 * @description
 */
public abstract class ServiceTemplate {

    protected abstract boolean checkPara(Object request);
    protected abstract Object callService(Object request);
    protected abstract Object assemblyResult(Object response);

    public Object doService(Object request) {
        if(checkPara(request)) {
            Object response = callService(request);
            return assemblyResult(response);
        } else {
            return Boolean.FALSE;
        }
    }
}
